<div id="page-wrapper">
        <!-- /.row -->
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading"><span class="judul-page">Edit Master Siswa</span></div>
                <div class="panel-body">
					<?php 
						echo form_open_multipart('mr_siswa/update', array('class' => 'form-horizontal', 'role' => 'form')); 
						foreach ($list as $row){ 
					?>
						<input type="hidden" name="nva_lama" value="<?php echo $row->nis; ?>">
						<div class="form-group">
							<label class="col-sm-2 control-label">NIS</label>
							<div class="col-sm-4 noInput">
								<input type="text" name="nva" class="form-control input-sm" placeholder="NIS" value="<?php echo $row->nva; ?>">
							</div>
						</div>
            <div class="form-group">
              <label class="col-sm-2 control-label">NVA</label>
              <div class="col-sm-4 noInput">
                <input type="text" name="nis" class="form-control input-sm" placeholder="NVA" value="<?php echo $row->nis; ?>">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">NIK</label>
              <div class="col-sm-4 noInput">
                <input type="text" name="nik" class="form-control input-sm" placeholder="NIK" value="<?php echo $row->nik; ?>">
              </div>
            </div>

						<div class="form-group">
							<label class="col-sm-2 control-label">Nama Lengkap</label>
							<div class="col-sm-7">
								<input type="text" name="nm_lengkap" class="form-control input-sm" placeholder="Nama Lengkap" value="<?php echo $row->nm_lengkap; ?>">
							</div>
						</div>
						
						<div class="form-group">
            <label class="col-sm-2 control-label">Jenis Kelamin</label>
            <div class="col-sm-9">
                <label class="radio-inline">
								<input type="radio" name="jk" value="L" <?php if ($row->jk == 'L'){echo "checked";} ?>>
								Laki-laki
							</label>

							<label class="radio-inline">
								<input type="radio" name="jk" value="P" <?php if ($row->jk == 'P'){echo "checked";} ?>>
								Perempuan
							</label>
                        </div>
                      </div>
					  
					  <div class="form-group">
							<label class="col-sm-2 control-label">Nama Panggilan</label>
							<div class="col-sm-7">
								<input type="text" name="nm_panggilan" class="form-control input-sm" placeholder="Nama Panggilan" value="<?php echo $row->nm_panggilan; ?>">
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">TTL</label>
							<div class="col-sm-4">
								<input type="text" name="tmp_lahir" class="form-control input-sm" placeholder="Tempat Lahir" value="<?php echo $row->tmp_lahir; ?>">
							</div>
							<div class="col-sm-2">
								<input type="text" name="tgl_lahir" class="form-control input-sm tanggal" placeholder="Tanggal Lahir" value="<?php echo date("d-m-Y", strtotime ($row->tgl_lahir)); ?>">
							</div>
						</div>
					  
						<div class="form-group">
							<label class="col-sm-2 control-label">Alamat</label>
							<div class="col-sm-7">
								<textarea name="alamat" class="form-control input-sm" rows="3" placeholder="Alamat Lengkap"><?php echo $row->alamat; ?></textarea>
							</div>
						</div>
					  
					    <div class="form-group">
							<label class="col-sm-2 control-label">No. Tlp</label>
							<div class="col-sm-4">
							  <input type="text" name="tlp" class="form-control input-sm" placeholder="No. Tlp" value="<?php echo $row->tlp; ?>">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">Email</label>
							<div class="col-sm-4">
							  <input type="text" name="email" class="form-control input-sm" placeholder="Email" value="<?php echo $row->email; ?>">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">Jarak</label>
							<div class="col-sm-4">
							  <input type="text" name="jarak" class="form-control input-sm" placeholder="Jarak" value="<?php echo $row->jarak; ?>">
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">Transportasi</label>
							<div class="col-sm-4">
							  <input type="text" name="trans" class="form-control input-sm" placeholder="Transportasi" value="<?php echo $row->trans; ?>">
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">Asal Sekolah</label>
							<div class="col-sm-4">
							  <input type="text" name="asal_sekolah" class="form-control input-sm" placeholder="Asal Sekolah" value="<?php echo $row->asal_sekolah; ?>">
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">Alamat Sekolah</label>
							<div class="col-sm-7">
								<textarea name="almt_sekolah" class="form-control input-sm" rows="3" placeholder="Alamat Lengkap Sekolah"><?php echo $row->almt_sekolah; ?></textarea>
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">Lembaga</label>
							<div class="col-sm-7">
								<select class="form-control input-sm" name="lembaga">
									<option value=""> - - Pilih Lembaga - - </option>
									<?php
										foreach($lembaga as $value){
											if($row->id_lembaga == $value['id_lembaga']){
												$s = "selected";
											}else{
												$s = "";
											}
											echo "<option value='".$value['id_lembaga']."' $s>$value[nama_lembaga]</option>";
										}
									?>
								</select>
							</div>
						</div>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-9">
                <button type="submit" onClick="validate()" class="btn btn-primary btn-sm">Update</button>
                <button type="reset" class="btn btn-danger btn-sm" onclick="history.back(-1)">Batal</button>
              </div>
            </div>
          <?php 
						}
						echo form_close();
					?>
                </div>
            </div>
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->

<script>
  function validate() {
    $("form").validate({
      rules: {
        nva: {
          required: true
        },
        nm_lengkap: {
          required: true
        },
		lembaga: {
          required: true
        },
      },
      messages: {
        nva: {
          required: "NVA harus diisi."
        },
        nm_lengkap: {
          required: "Nama lengkap harus diisi."
        },
		lembaga: {
          required: "Lembaga harus dipilih."
        },
      }
    });

    var topicInputs = topics.find("input").attr("disabled", !inital);
  };
</script>